ci: skip claude.yml when comment is '@claude review'#2337
ci: skip claude.yml when comment is '@claude review'#2337felixweinberger merged 1 commit intomainfrom
Conversation
Comments starting with '@claude review' are handled by the hosted code-review webhook, which creates a dedicated check run. Running this workflow on the same trigger causes both systems to respond to one comment — the GHA run then fails on fork PRs because it tries to fetch the fork branch from origin.
e0d7857 to
18623f0
Compare
There was a problem hiding this comment.
LGTM — straightforward CI condition fix to avoid double-triggering on @claude review comments.
Extended reasoning...
Overview
This PR modifies a single GitHub Actions workflow file (.github/workflows/claude.yml) to add a !startsWith guard to the issue_comment event condition. This prevents the workflow from firing when the hosted code-review webhook already handles the same comment.
Security risks
None. The change only narrows when a CI workflow triggers — it does not touch application code, secrets, permissions, or authentication logic.
Level of scrutiny
Minimal scrutiny is appropriate. This is a one-line conditional change in a CI workflow file, mirroring an equivalent change already landed in the TypeScript SDK. The logic is simple and the intent is clear from the PR description.
Other factors
No bugs were found. No prior reviews exist on this PR. The change is self-contained, non-breaking, and well-motivated by the observed double-trigger behavior on fork PRs.
There was a problem hiding this comment.
LGTM, straightforward CI condition to avoid double-triggering on @claude review comments.
Extended reasoning...
Overview
This PR modifies a single line in .github/workflows/claude.yml, adding a !startsWith guard to the issue_comment condition. This prevents the GitHub Action from firing when the hosted code-review webhook already handles @claude review comments.
Security risks
None. The change only narrows the set of comments that trigger the workflow. It does not grant new permissions, expose secrets, or modify any runtime behavior.
Level of scrutiny
Minimal scrutiny needed. This is a one-line CI config tweak that filters out a specific comment pattern. The logic is simple and the intent is clearly explained in the PR description with a concrete example of the double-trigger problem.
Other factors
No bugs were found. No outstanding reviewer comments. The change mirrors an equivalent fix already applied to the TypeScript SDK. The modification is self-contained and easily reversible.
CCR now handles code review on this repo (since ~2026-03-08), making this workflow redundant. The workflow has been running on every PR push but cannot post reviews due to read-only pull-requests permissions, so it was consuming compute without producing visible output. The claude.yml workflow for @claude mentions is retained. #2337 already added the '@claude review' exclusion guard so it does not overlap with CCR. Matches typescript-sdk#1754.
Excludes
@claude reviewcomments from triggering this workflow.Motivation and Context
Comments starting with
@claude revieware handled by the hosted code-review webhook, which creates a dedicated "Claude Code Review" check run. When this GitHub Action also fires on the same comment, both systems respond — the GHA run then fails on fork PRs because it tries to fetch the fork branch from origin, leaving a red ❌ on the PR alongside the actual (successful) review.How Has This Been Tested?
Observed the double-trigger on typescript-sdk PR #1003:
@claude reviewfired both the hosted webhook (check run started correctly) and the equivalent claude.yml workflow (failed withgit fetch origin <fork-branch>). Same workflow file here.Breaking Changes
None.
Types of changes
Checklist
Additional context
Only the
issue_commentevent is excluded since that's the only event type the hosted webhook listens to.@claude reviewin a PR review comment or issue body still triggers this workflow as before.Mirror of modelcontextprotocol/typescript-sdk#1737.